﻿using System;
namespace Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg {
    
    
    public class XSideliik : global::Xtee.Core.Schema.XsdString {
        
        public const string ELEKTRONPOSTIAADRESS = "EMAIL";
        
        public const string FAKS = "FAX";
        
        public const string INTERNETIWWWAADRESS = "WWW";
        
        public const string MOBIILTELEFON = "MOB";
        
        public const string MODEM = "MOD";
        
        public const string MUUSIDEVAHEND = "MUU";
        
        public const string TELEFON = "TEL";
        
        public const string TELEKS = "TELEX";
        
        public XSideliik(string value) : 
                base(value) {
            this.Validate();
            string annot = null;
            if (Value == "EMAIL") {
                annot = "Elektronposti aadress";
            }
            if (Value == "FAX") {
                annot = "Faks";
            }
            if (Value == "WWW") {
                annot = "Interneti WWW aadress";
            }
            if (Value == "MOB") {
                annot = "Mobiiltelefon";
            }
            if (Value == "MOD") {
                annot = "Modem";
            }
            if (Value == "MUU") {
                annot = "Muu sidevahend";
            }
            if (Value == "TEL") {
                annot = "Telefon";
            }
            if (Value == "TELEX") {
                annot = "Teleks";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public XSideliik() : 
                base(string.Empty) {
        }
        
        public static bool TryParse(string value, out global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.XSideliik result) {
            try {
                result = new global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.XSideliik(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator String (XSideliik value) {
            return value.Value;
        }
        
        public static implicit operator XSideliik (string value) {
            if (value==null) {
                return null;
            }
            return new XSideliik(value);
        }
    }
}
